<template>
    <div class="app">
        <h2>信息：{{ functioninfo }}</h2>
        <p>亦小染的成绩：{{ scorelevel }}</p>
    </div>
</template>
<script>
import { reactive, computed, ref } from "vue"
export default {
    setup() {
        const info = reactive({
            name: "小染呀",
            age: 19
        })
        // 函数式编程
        // 记得return
        const functioninfo = computed(() => {
            return info.name + " " + info.age
        })

        const score = ref(89)
        const scorelevel = computed(() => {
            console.log(score);
            console.log(score.value);
            // ref这里记得解包噢
            return score.value > 60 ? "合格" : "不合格"
        })
        return {
            info,
            functioninfo,
            scorelevel
        }
    }
}
</script>
<style scoped lang="less"></style>